package edu.hunau.cxb19.oop.class18;

import org.junit.Test;

import edu.hunau.cxb19.oop.class18.generic.CollectionUtils;
import edu.hunau.cxb19.oop.class18.generic.MyArrayList;
import edu.hunau.cxb19.oop.class18.generic.MyList;

/**
 *
 * @author hb
 *
 *         2020-03-19 15:01:20
 */
public class MyListTest {

	@Test
	public void test() {
		MyList<User> list = new MyArrayList<User>();
		CollectionUtils.addAll(list, new User(1001, "haoren"), new User(1002, "lucy"), new User(1003, "lily"));

		// 对集合进行排序
		//CollectionUtils.sort(list);
		CollectionUtils.print(list);
		
		
		MyList<?> myList=new MyArrayList<User>();//编译通过
		//myList.add(new User());//编译失败。在编译期间无法知道myList的泛型的类型

	}
}
